package com.example.huawei.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @TableName comment_record
 */
@ApiModel("评论实体类")
@TableName(value = "comment_record")
@Data
public class CommentRecord implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId
    private String id;
    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String userId;
    /**
     * 评论内容
     */
    @ApiModelProperty(value = "评论内容")
    private String content;
    /**
     * 帖子id
     */
    @ApiModelProperty(value = "帖子id")
    private String releaseId;
    /**
     * 父级id  null表示顶级评论
     */
    @ApiModelProperty(value = "父级id")
    private String parentId;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 排序  byTime最新 byCount最热
     */
    @ApiModelProperty(value = "排序 byTime最新 byCount最热")
    @TableField(exist = false)
    private String order;

    /**
     * 是否有子级评论 1是0否
     */
    @ApiModelProperty(value = "是否有子级评论 1是0否")
    @TableField(exist = false)
    private Integer hasChild;

    /**
     * 加入平台时长(天)
     */
    @ApiModelProperty(value = "加入平台时长(天)")
    @TableField(exist = false)
    private String joinTime;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    @TableField(exist = false)
    private String avatar;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    @TableField(exist = false)
    private String username;

    /**
     * 评论数量
     */
    @ApiModelProperty(value = "评论数量")
    @TableField(exist = false)
    private Integer commentCount;

    /**
     * 点赞数量
     */
    @ApiModelProperty(value = "点赞数量")
    @TableField(exist = false)
    private Integer likeCount;

    /**
     * 当前用户是否点赞
     */
    @ApiModelProperty(value = "当前用户是否点赞")
    @TableField(exist = false)
    private Boolean likeFlag;


    /**
     * 二级评论
     */
    @ApiModelProperty(value = "二级评论")
    @TableField(exist = false)
    private List<CommentRecord> commentList;

}
